Namespace - LJCTextDataReaderLib
Parameters
name - The field name.
Returns
The field index value.
Syntax
C# |
public Int32 GetOrdinal(String name)
|
Retrieves the index of the data field with the specified name.
(DE)
Remarks
Required method if field mapping is used.
Example
C# |
using LJCTextDataReaderLib;
TextDataReader textReader = new TextDataReader();
string[] lines = new string[]
{
"FirstName, LastName",
"John, Doe",
"Jane, Doe"
};
textReader.LJCSetLines(lines);
while(textReader.ReadLine())
{
int firstNameIndex = textReader.GetOrdinal("FirstName");
int lastNameIndex = textReader.GetOrdinal("LastName");
string firstName = textReader.GetString(firstNameIndex);
string lastName = textReader.GetString(lastNameIndex);
}
|
Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.